import { http } from "@/utils/http";

type ResultTable = {
  success: boolean;
  data?: {
    /** 列表数据 */
    list: Array<any>;
    /** 总条目数 */
    total?: number;
    /** 每页显示条目个数 */
    pageSize?: number;
    /** 当前页数 */
    currentPage?: number;
  };
};

/** 获取分类管理列表 */
export const getCategoryList = (data?: object) => {
  return http.request<ResultTable>("post", "/category", { data });
};

/** 获取家庭管理列表 */
export const getFamilyList = (data?: object) => {
  return http.request<ResultTable>("post", "/family", { data });
};
/** 获取家庭财产管理列表 */
export const getPropertyList = (data?: object) => {
  return http.request<ResultTable>("post", "/property", { data });
};
/** 获取理财计划管理列表 */
export const getPlanList = (data?: object) => {
  return http.request<ResultTable>("post", "/plan", { data });
};
/** 获取收支账单管理列表 */
export const getBillsList = (data?: object) => {
  return http.request<ResultTable>("post", "/bills", { data });
};
/** 获取资产账单管理列表 */
export const getBillPropertysList = (data?: object) => {
  return http.request<ResultTable>("post", "/bills/property", { data });
};

/** 获取理财账单管理列表 */
export const getBillsManageMoneyList = (data?: object) => {
  return http.request<ResultTable>("post", "/bills/manage_money", { data });
};
